home *** CD-ROM | disk | FTP | other *** search
- Path: thor.tu.hac.com!collins
- From: collins@thor.tu.hac.com (Ron Collins)
- Newsgroups: comp.lang.c
- Subject: Re: Array Parameters
- Date: 4 Jan 1996 14:07:08 GMT
- Organization: Advanced Depot Systems
- Message-ID: <4cgmuc$k9k@hacgate2.hac.com>
- References: <wayne.820650643@hawk> <4ce349$4j9@hacgate2.hac.com> <820701694snz@genesis.demon.co.uk> <4cg104$qmp@nervous.pdb.sni.de>
- NNTP-Posting-Host: thor.tu.hac.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Josef Moellers (mollers.pad@sni.de) wrote:
- : In <820701694snz@genesis.demon.co.uk> Lawrence Kirby <fred@genesis.demon.co.uk> writes:
-
- : [ ... ]
-
- : > It is impossible
- : >to specify an array as a function parameter since, as in the example above,
-
- : Well, if you MUST pass an array by value and not by reference, wrap it
- : into a structure:
-
- : struct foo {
- : int array[100];
- : };
- : ...
-
-
- I don't get it ... what does this buy me ("me" == any competant C programmer)?
- I'm still going to get a pointer-to-something, whether it's a pointer-to-
- structure, pointer-to-array, or pointer-to-first-element. I still need to
- know which one is used so I can access the array elements properly. (Although,
- there is seldom any difference between passing a pointer to an array, and
- a pointer to the first element of that array).
-
- BTW, passing a pointer to an object is _not_ the same as pass by reference.
- C does not support pass-by-reference at all.
-
-
-
- -- Collins --
-
- -----
- The views expressed here are mine alone.
-
- Ron Collins/Hughes Aircraft Company/M20,P20/Tucson Az 85706
- rcollins@thor.tu.hac.com collins@seagull.rtd.com
- ยก----
-